//! Header for the TachometerObserver class
/*!
	\file TachometerObserver.h
	\author Andreas Lehner
	\date 22.11.2012

*/
#ifndef TACHOMETEROBSERVER_H
#define TACHOMETEROBSERVER_H

#include "ObserverBase.h"

//! Updates the Tachometer and writes the speed to AnalogDisplay.
/*!
\class TachometerObserver
The class TachometerObserver retrieves the speed of a PKW. It interacts with
the AnalogDisplay and sends its values to that display. It attaches and detaches
itself in the observer list of class Automobile. (Observer Pattern)
*/
class TachometerObserver : public ObserverBase {
public:
	//! CTor of TachometerObserver
	/*!
	Constructs a TachometerObserver and attaches it to the observer list
	of class Automobile. It also initializes a new AnalogDisplay.
	\param automobile A concrete subject (PKW*) the observer listens to.
	*/
	TachometerObserver(PKW * automobile);
	//! DTor of TachometerObserver
	/*!
	Destructs an TachometerObserver and detaches it from the observer list
	of class Automobile. The AnalogDisplay is being deleted.
	*/
	~TachometerObserver();
	//! Updates the speed of a PKW
	/*!
	Retrieves the current speed and sends the value to
	the AnalogDisplay for output.
	\throw std::exception if sending to the AnalogDisplay fails.
	*/
	virtual void Update();

private:
	//describes the current driven speed of a PKW
	double mSpeed;
};

#endif